/**
 * There are <a href="https://www.hdzhx.com">邯郸智讯</a> code generation
 */
package com.boxin.ims.modules.wechat.entity.share;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import org.hibernate.validator.constraints.Length;

import com.thinkgem.jeesite.common.persistence.BaseEntity;
import com.thinkgem.jeesite.modules.sys.entity.User;

/**
 * 分享转发配置Entity
 * @author Jakemanse
 * @version 2013-10-01
 */
@Entity
@Table(name = "wp_share_config")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class ShareConfig extends BaseEntity {
	
	private static final long serialVersionUID = 1L;
	private Long id; 		// 编号
	private User user; 		// 用户
	private Boolean startup;	//是否启动该活动
	private Boolean repeats;	//是否允许重复转发获奖
	private Boolean displayRank;	//是否显示次
	private Boolean addScore;	//是否增加积分
	private Integer score;		//增加的积分分值
	private Integer startNumber;  //默认起始排名
	private String defaultReply;	//默认回复信息.
	private String awardReply;		//中奖后的回复内容
	private Date createTime;	// 创建日期
	private Date updateTime;		//结束时间
	private Integer validDays;	//中奖后有效天数
	private String delFlag;	// 删除标记（0：正常；1：删除）
	private String remarks; // 备注

	public ShareConfig() {
		this.createTime = new Date();
		displayRank = false;
		this.delFlag = DEL_FLAG_NORMAL;
	}

	public ShareConfig(Long id){
		this();
		this.id = id;
	}
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	//@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seq_wechat_share_shareConfig")
	//@SequenceGenerator(name = "seq_wechat_share_shareConfig", sequenceName = "seq_wechat_share_shareConfig")
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne
	@JoinColumn(name="user_id")
	@NotFound(action = NotFoundAction.IGNORE)
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
	@NotNull
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}
	

	@Length(min=0, max=255)
	public String getRemarks() {
		return remarks;
	}

	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}
	
	@NotNull
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@Length(min=1, max=1)
	public String getDelFlag() {
		return delFlag;
	}

	public void setDelFlag(String delFlag) {
		this.delFlag = delFlag;
	}


	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public Integer getValidDays() {
		return validDays;
	}

	public void setValidDays(Integer validDays) {
		this.validDays = validDays;
	}

	public String getDefaultReply() {
		return defaultReply;
	}

	public void setDefaultReply(String defaultReply) {
		this.defaultReply = defaultReply;
	}

	public String getAwardReply() {
		return awardReply;
	}

	public void setAwardReply(String awardReply) {
		this.awardReply = awardReply;
	}

	public Boolean getStartup() {
		return startup;
	}

	public void setStartup(Boolean startup) {
		this.startup = startup;
	}

	public Boolean getRepeats() {
		return repeats;
	}

	public void setRepeats(Boolean repeats) {
		this.repeats = repeats;
	}

	public Integer getStartNumber() {
		return startNumber;
	}

	public void setStartNumber(Integer startNumber) {
		this.startNumber = startNumber;
	}

	public Boolean getAddScore() {
		return addScore;
	}

	public void setAddScore(Boolean addScore) {
		this.addScore = addScore;
	}

	public Integer getScore() {
		return score;
	}

	public void setScore(Integer score) {
		this.score = score;
	}

	public Boolean getDisplayRank() {
		return displayRank == null ? false : true;
	}

	public void setDisplayRank(Boolean displayRank) {
		this.displayRank = displayRank;
	}

	
	
	
	
	
}


